import 'package:dmz/business/home/controller/set_purchase_controller.dart';
import 'package:dmz/business/home/widgets/set_moto_widgets.dart';
import 'package:flutter/material.dart';

import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../base/pageWidget/base_stateful_widget.dart';
import '../../../base/widget/defult_widget.dart';

class SetPurchasePage extends BaseStatefulWidget<SetPurchaseController> {
  const SetPurchasePage({super.key});

  @override
  String titleString() => '服务续费'.tr;

  @override
  get updateId => 'purchase';

  @override
  List<Widget>? appBarActionWidget(BuildContext context) {
    return [
      DefaultText('购买'.tr, 28.sp, textColor: const Color(0xFF23C565))
          .paddingOnly(right: 32.sp)
          .addGestureDetector(controller.didpurchase)
    ];
  }

  @override
  Widget buildContent(BuildContext context) {
    return ListView(children: [
      Obx(() => SetMotoWidgets.purchaseTopWidget(
          controller.pageDatas,
          controller.selecIndex.value,
          controller.selectChange,
          controller.agreed.value,
          (type) => controller.chnangeAgree(type))),
      SetMotoWidgets.purchaseBottomWidget()
    ]);
  }
}
